<template>
  <div>
    <div>测试v-if, 条件判断</div>
    <div>
      <ul>
        <template v-for="(item, index) in list">
            <li :key="item.name" v-if="item.age>30">{{index}}-{{item.name}}</li>
            <li :key="item.name" v-else-if="item.age<24">{{index}}-{{item.name}}--{{item.age}}</li>
            <li :key="item.name" v-else>{{index}}-{{item.age}}</li>
        </template>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "v-if",
  data() {
    return {
      list: [
        { name: "Gran", age: 25 },
        { name: "Anabelle", age: 23 },
        { name: "Anna Strenger", age: 45 },
        { name: "Cirilla", age: 54 },
      ],
    };
  },
  methods: {
    change() {
      this.xxx = "222";
    },
  },
};
</script>
